home *** CD-ROM | disk | FTP | other *** search
- Path: koobera.math.uic.edu!djb
- From: djb@koobera.math.uic.edu (D. J. Bernstein)
- Message-ID: <1996Feb1922.17.19.879@koobera.math.uic.edu>
- Date: 19 Feb 1996 22:17:19 GMT
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Subject: Re: Access carry flag from C
- References: <Dn1C9z.DGv.0.net@indra.com>
- Organization: IR
-
- Steve Sullivan <sullivan@indra.com> wrote:
- > i = j + k;
- > if (overflowed) ....;
-
- A smart compiler will optimize ``if (i < j)''---I'm assuming here that
- all variables are unsigned---into a test of the carry bit.
-
- (I've been saying for years that every compiler should provide a
- _documented_ idiom for every possible machine-language operation.)
-
- ---Dan
-